<template>
  <div ref="wrapper" class="wrapper">
      <div class="content">
          <slot></slot>  
      </div>
  </div>
</template>

<script>
import BScorll from 'better-scroll'
export default {
    props:{
        pullUpLoad:{
            type:Boolean,
            default:false
        }
    },
    data(){
        return {
            scroll:null
        }
    },
    methods:{
        refresh(){
            console.log(2222)
            this.scroll && this.scroll.refresh()
        }
    },
    mounted(){
        this.scroll=new BScorll(this.$refs.wrapper,{
            probeType:3,
            click:true,
            observeDOM:true,
            pullUpLoad:this.pullUpLoad
        })
        // 监听滚动位置
        this.scroll.on('scroll',position=>{
            // console.log(position)
            this.$emit('scroll',position)
        })

        this.scroll.on('pullingUp',()=>{
            this.$emit('pullingUp')
        })
    }
}

</script>
<style scoped>
</style>